package cn.tedu.egmvc01.Controller;

import cn.tedu.egmvc01.entity.Address;
import cn.tedu.egmvc01.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/address/")
public class AddressController {
    @Autowired
    private AddressMapper addressMapper;
    @RequestMapping("insert")
    public String insert(Address address){
        addressMapper.insert(address);
        return "添加成功";
    }

    @RequestMapping("list")
    public List<Address> list(){
        return addressMapper.list();
    }


}
